package com.plate.common.web.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;

/**
 * @ClassName RequestContextUtils
 * @Description TODO
 * @Author jiaxd
 * @Date 2023年10月29日 20:29
 * @Version 1.0
 */

public class RequestContextUtils {

    public static HttpServletRequest getRequest(){
        return ((ServletRequestAttributes)(Objects.requireNonNull(RequestContextHolder.getRequestAttributes()))).getRequest();
    }

}
